package com.jr.mapper;

import com.jr.pojo.Pet;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

@Component
public interface PetMapper {

    int insertPet(Pet pet);

    ArrayList<Pet> selectByOwnerId(@Param("ownerId") Integer ownerId);

    Pet selectById(@Param("petId") Integer petId);

    int updatePet(Pet pet);

    int deletePet(@Param("petId") Integer petId);

    // 分页查询宠物列表
    ArrayList<Pet> selectByPage(@Param("ownerId") Integer ownerId, @Param("offset") int offset, @Param("pageSize") int pageSize);

    // 查询宠物总数
    int countByOwnerId(@Param("ownerId") Integer ownerId);
}
